export const replaceKeyowrds = (str: string) => {
    const regex = /\[(.*?)\]\s(https:\/\/[^\s]+?)(?=\s|$)/g;
    const replacedStr = str.replace(regex, (match, group) => {
        const url = match.split(' ')[0]; // 获取URL
        const text = group; // 获取链接文本
        return `<a href="${url}">${text}</a>`;
    });
    return replacedStr;
};

export const isLogin = () => {
    const token = localStorage.getItem('token');
    return !!token;
};
